/*
 * @Author: lwHao
 * @Date: 2020-10-22 15:02:56
 * @LastEditors: lwHao
 * @LastEditTime: 2020-10-23 16:02:05
 */
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/pages/Home'

Vue.use(VueRouter)

export const createRouter = () => {
  const router = new VueRouter({
    mode: 'history', //兼容前后端
    routes: [
      {
        path: '/',
        name: 'Home',
        component: Home,
      },
      {
        path: '/about',
        neme: 'About',
        component: () => import('@/pages/About')
      },
      {
        path: '/posts',
        neme: 'Posts',
        component: () => import('@/pages/Posts')
      },
      {
        path: '*',
        neme: 'notfound',
        component: () => import('@/pages/404')
      },
    ]
  })
  return router
}